package com.hpsk.shopgen.model.genconfig.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hpsk.common.RespResult;
import com.hpsk.common.RespUtils;
import com.hpsk.shopgen.model.genconfig.entity.GenConfig;
import com.hpsk.shopgen.model.genconfig.param.GenConfigListParam;
import com.hpsk.shopgen.model.genconfig.service.IGenConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 生成配置 前端控制器
 * </p>
 *
 * @author huangwang
 * @since 2025-07-07
 */
@RestController
@RequestMapping("/genConfig")
@Tag(name = "代码生成配置")
@AllArgsConstructor(onConstructor_ = @__(@Autowired))
public class GenConfigController {

    private final IGenConfigService genConfigService;
    @ApiOperationSupport(order = 1)
    @Operation(summary = "获取代码生成详细配置分页")
    @GetMapping("/list")
    public RespResult<List<GenConfig>> list(@ParameterObject GenConfigListParam genConfigListParam) {
        return RespUtils.data(genConfigService.list(genConfigListParam));
    }
}
